home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
004
/
astr0106.arc
/
ASTRO101.BAS
next >
Wrap
BASIC Source File
|
1986-03-02
|
8KB
|
214 lines
10 REM Written by
20 REM Lee Roger Taylor, Jr.
30 REM 4002 Madison Drive
40 REM Rock Springs, Wyoming 82901
50 REM 307-382-3878
60 DEFDBL Q
70 DEFDBL W
80 W=6.6460656#
90 DEFDBL Z
100 Z=2400.051262#
110 Q=2.581E-05
120 DEF FNRAD(X)=X*1.745329E-02
130 KEY OFF
140 DEF FNARCSIN(X)=ATN(X/SQR(1-X^2))
150 DEF FNDEG(X)=X*57.29577
160 DEF FNARCCOS(X)=1.570796-ATN(X/SQR(1-X^2))
170 CLS:LOCATE 3,22:PRINT STRING$(35,32)
180 LOCATE 4,22:PRINT STRING$(35,32)
190 LOCATE 5,22:PRINT STRING$(35,32)
200 LOCATE 6,22:PRINT STRING$(35,32)
210 LOCATE 7,22:PRINT STRING$(35,32)
220 LOCATE 8,22:PRINT STRING$(35,22)
230 LOCATE 4,23:PRINT "EQUATORIAL TO HORIZON COORDINATES"
240 LOCATE 5,27:PRINT "This Program will convert"
250 LOCATE 6,27:PRINT "Equatorial Coordinates to"
260 LOCATE 7,30:PRINT "Horizon Coordinates"
270 LOCATE 15,7:INPUT "Do You want a Printout? (Y/N): ",DISPLAY$
280 LOCATE 22,7:PRINT "Press any key to continue":IF INKEY$="" THEN 280
290 GOSUB 820
300 GOSUB 1260
310 GOSUB 1910
320 GOSUB 1320
330 GOSUB 1410
340 CLS:LOCATE 6,5:PRINT "RIGHT ASCENSION OF OBJECT:"
350 LOCATE 8,15:PRINT "Hours (##): "
360 LOCATE 8,27:INPUT "",HR
370 LOCATE 10,15:PRINT "Minutes (##):"
380 LOCATE 10,29:INPUT "",MIN
390 LOCATE 12,15:PRINT "Seconds (##): "
400 LOCATE 12,29:INPUT "",SEC
410 HR$=STR$(HR):MIN$=STR$(MIN):SEC$=STR$(SEC)
420 RIGHTASCENSION$=HR$+":"+MIN$+":"+SEC$
430 HR#=((MIN+(SEC/60))/60)+HR
440 RIGHTASCEN#=HR#
450 HOURANGLE#=LST#-RIGHTASCEN#
460 IF HOURANGLE#<0 THEN HOURANGLE#=HOURANGLE#+24
470 CLS:LOCATE 6,5:PRINT "DECLINATION OF OBJECT: "
480 LOCATE 8,15:PRINT "Degrees (##): "
490 LOCATE 8,29:INPUT "",HR
500 LOCATE 10,15:PRINT "Minutes (##): "
510 LOCATE 10,29:INPUT "",MIN
520 LOCATE 12,15:PRINT "Seconds (##): "
530 LOCATE 12,29:INPUT "",SEC
540 HR$=STR$(HR):MIN$=STR$(MIN):SEC$=STR$(SEC)
550 DECLINA$=HR$+":"+MIN$+":"+SEC$
560 HR#=((MIN+(SEC/60))/60)+HR
570 DECLINATION#=HR#
580 HOURDEG#=HOURANGLE#*15
590 DECLINATION#=FNRAD(DECLINATION#):PHI#=FNRAD(PHI#):H#=FNRAD(HOURDEG#)
600 ALTA#=(SIN(DECLINATION#)*SIN(PHI#))+(COS(DECLINATION#)*COS(PHI#)*COS(H#))
610 ALTA#=FNARCSIN(ALTA#)
620 ALTITUDE#=FNDEG(ALTA#)
630 '
640 AZIMUTH3#=(SIN(DECLINATION#)-(SIN(PHI#)*SIN(ALTA#)))/(COS(PHI#)*COS(ALTA#))
650 AZIMUTH2#=FNARCCOS(AZIMUTH3#)
660 AZIMUTH#=FNDEG(AZIMUTH2#)
670 TEST#=SIN(H#)
680 TEST#=FNDEG(TEST#)
690 IF TEST#=>0 THEN AZIMUTH#=360-AZIMUTH#
700 CLS
710 IF DISPLAY$="Y" THEN GOSUB 1680
720 LOCATE 5,10:PRINT "The Coordinates you gave should put the Object at the following"
730 LOCATE 6,29:PRINT "Horizon Coordinates"
740 LOCATE 8,45:PRINT "Right Ascension: ";RIGHTASCENSION$
750 LOCATE 9,45:PRINT "Declination: ";DECLINA$
760 LOCATE 8,5:PRINT "Date of Position: ";DAT$
770 GOSUB 1530
780 LOCATE 11,7:PRINT "Time of Observation: "TIM$;AP$
790 LOCATE 20,5:INPUT "Do you want another? (Y/N) ",QUE$
800 IF QUE$="Y" THEN 10 ELSE 810
810 END
820 'TIME AND DATE ROUTINE
830 CLS:LOCATE 6,7:PRINT "What is the TIME of OBSERVATION?"
840 LOCATE 8,10:PRINT "What is the HOUR (1-12): "
850 LOCATE 8,35:INPUT "",HR
860 LOCATE 10,10:PRINT "What are the MINUTES (##): "
870 LOCATE 10,37:INPUT "",MIN
880 LOCATE 12,10:PRINT "What are the SECONDS (##): "
890 LOCATE 12,37:INPUT "",SEC
900 HR$=STR$(HR):MIN$=STR$(MIN):SEC$=STR$(SEC)
910 TIM$=HR$+":"+MIN$+":"+SEC$
920 LOCATE 14,10:INPUT "Is Daylight Savings Time in effect? (Y/N) ",QUE$
930 IF QUE$="Y" THEN HR=HR-1
940 HR#=((MIN+(SEC/60))/60)+HR
950 HRD#=HR#
960 LOCATE 16,10:INPUT "IS IT AM OR PM? (A/P) ",AP$
970 IF AP$="P" THEN HRD#=HRD#+12
980 CLS:LOCATE 6,10:PRINT "DATE INFORMATION"
990 LOCATE 8,15:PRINT "MONTH (##): "
1000 LOCATE 8,27:INPUT "",MM
1010 LOCATE 10,15:PRINT "DATE (##): "
1020 LOCATE 10,26:INPUT "",DD
1030 LOCATE 12,15:PRINT "YEAR (####): "
1040 LOCATE 12,28:INPUT "",YEAR
1050 MM$=STR$(MM):DD$=STR$(DD):YEAR$=STR$(YEAR)
1060 DAT$=MM$+"/"+DD$+"/"+YEAR$
1070 UT%=MM
1080 RETURN
1090 'COMPUTATION FOR SPS
1100 D8%=INT(DD):F8#=D8%-DD-.5
1110 J8%=-INT(7*(INT((UT%+9)/12)+YEAR)/4)
1120 S8=SGN(UT%-9):A8=ABS(UT%-9)
1130 J9%=INT(YEAR+S8*INT(A8/7))
1140 J9%=-INT((INT(J9%/100)+1)*3/4)
1150 J8%=J8%+INT(275*UT%/9)+D8%+1*J9%
1160 JD#=J8%+(52152.33*33)+2*1+367*YEAR
1170 IF F8#>=0 THEN GOTO 1190
1180 F8#=F8#+1:JD#=JD#-1
1190 J9#=JD#+F8#-DAYS%+1
1200 S5#=J9#-(200*12075.1)
1210 T5#=S5#/(365.25*100)
1220 R8#=W+(Z*T5#)+(2.581E-05*T5#^2)
1230 SPS1#=R8#-(24*(YEAR-1900))
1240 SPS#=24-SPS1#
1250 RETURN
1260 'DATE COMPUTATION
1270 IF MM<2 THEN MM#=(((MM-1)*63)/2)
1280 IF MM>1 THEN MM#=(((MM+1)*30.6)-63)
1290 DAYS=MM#+DD+1
1300 DAYS%=INT(DAYS)
1310 RETURN
1320 'LOCATION INFORMATION
1330 CLS
1340 LOCATE 10,7:PRINT "What is the longitude? "
1350 LOCATE 10,30:INPUT "",LONGITUDE#
1360 LOCATE 12,7:PRINT "What is the Time Zone Correction? "
1370 LOCATE 12,41:INPUT "",TIMEZONE#
1380 LOCATE 14,7:PRINT "What is the Latitude? "
1390 LOCATE 14,29:INPUT "",PHI#
1400 RETURN
1410 'GMT COMPUTATION
1420 GMT#=HRD#-TIMEZONE#
1430 IF GMT#>24 THEN GMT#=GMT#-24
1440 IF GMT#<0 THEN GMT#=GMT#+24
1450 GST#=((DAYS%*.0657098)-SPS#)+(GMT#*1.002738)
1460 IF GST#>24 THEN GST#=GST#-24
1470 IF GST#<0 THEN GST#=GST#+24
1480 LONGITUDIFF#=LONGITUDE#/15
1490 LST#=GST#-LONGITUDIFF#
1500 IF LST#>24 THEN LST#=LST#-24
1510 IF LST#<0 THEN LST#=LST#+24
1520 RETURN
1530 'PRINTOUT CONVERSION FORMULA
1540 IF N=1 THEN X#=AZIMUTH#
1550 IF N=0 THEN X#=ALTITUDE#
1560 XT%=INT(X#):XA#=X#-XT%
1570 A#=XA#*60:B%=INT(A#):C#=A#-B%:D#=C#*60:E%=INT(D#+.5)
1580 IF E%=60 THEN B%=B%+1:E%=0
1590 IF B%=60 THEN XT%=XT%+1:B%=0
1600 IF N=1 THEN GOTO 1620
1610 LOCATE 13,5:PRINT USING "ALTITUDE ## Degrees ## Minutes ## Seconds";XT%,B%,E%:GOTO 1630
1620 LOCATE 14,5:PRINT USING "AZIMUTH ### Degrees ## Minutes ## Seconds";XT%,B%,E%
1630 N=N+1
1640 IF N<2 THEN GOTO 1540
1650 N=0
1660 RETURN
1670 RETURN
1680 'PRINTER OUTPUT
1690 LPRINT CHR$(12);:LPRINT :LPRINT :LPRINT
1700 LPRINT CHR$(14) TAB(1);"Equatorial to Horizon Coordinates"
1710 LPRINT:LPRINT:LPRINT
1720 LPRINT TAB(2)DAT$ TAB(20)TIM$ TAB(38)RIGHTASCENSION$ TAB(52)DECLINA$
1730 LPRINT STRING$(80,196)
1740 LPRINT:LPRINT
1750 IF N=1 THEN X#=AZIMUTH#
1760 IF N=0 THEN X#=ALTITUDE#
1770 XT%=INT(X#):XA#=X#-XT%
1780 A#=XA#*60:B%=INT(A#):C#=A#-B%:D#=C#*60:E%=INT(D#+.5)
1790 IF E%=60 THEN B%=B%+1:E%=0
1800 IF B%=60 THEN XT%=XT%+1:B%=0
1810 IF N=1 THEN GOTO 1830
1820 LPRINT USING " ALTITUDE: ## Degrees ## Minutes ## Seconds";XT%,B%,E%:GOTO 1840
1830 LPRINT USING " AZIMUTH: ### Degrees ## Minutes ## Seconds";XT%,B%,E%
1840 N=N+1
1850 IF N<2 THEN GOTO 1750
1860 N=0
1870 LPRINT:LPRINT:LPRINT:LPRINT:LPRINT
1880 LPRINT STRING$(80,196)
1890 LPRINT CHR$(12);
1900 RETURN
1910 IF YEAR=1975 THEN SPS#=17.39761
1920 IF YEAR=1976 THEN SPS#=17.413525#
1930 IF YEAR=1977 THEN SPS#=17.36373
1940 IF YEAR=1978 THEN SPS#=17.379643#
1950 IF YEAR=1979 THEN SPS#=17.395558#
1960 IF YEAR=1980 THEN SPS#=17.411472#
1970 IF YEAR=1981 THEN SPS#=17.361677#
1980 IF YEAR=1982 THEN SPS#=17.377592#
1990 IF YEAR=1983 THEN SPS#=17.393506#
2000 IF YEAR=1984 THEN SPS#=17.409421#
2010 IF YEAR=1985 THEN SPS#=17.359625#
2020 IF YEAR=1986 THEN SPS#=17.375539#
2030 IF YEAR=1987 THEN SPS#=17.391453#
2040 IF YEAR=1988 THEN SPS#=17.407368#
2050 IF YEAR=1989 THEN SPS#=17.357573#
2060 IF YEAR=1990 THEN SPS#=17.373487#
2070 IF YEAR=1991 THEN SPS#=17.389402#
2080 IF YEAR=1992 THEN SPS#=17.405316#
2090 IF YEAR=1993 THEN SPS#=17.355521#
2100 IF YEAR=1994 THEN SPS#=17.371435#
2110 IF YEAR=1995 THEN SPS#=17.387349#
2120 IF YEAR=1996 THEN SPS#=17.403263#
2130 RETURN
F YEAR=1994 THEN SPS#=17.3714